//检验一个队列的长度

var queue = [];
queue.push(1);
queue.push(2);
queue.push(3);
queue.push(4);
while (queue.length) {
    const top = queue.pop();
    console.log(top);
}